import cv2
import numpy as np

logo = cv2.imread('./res/logo.png')
cat = cv2.imread('./res/cat.jpg')
cv2.imshow('logo', cat)
logo_sharp = np.shape(logo)
mask = cv2.split(logo)[1]
mask[mask > 0] = 255

m = cv2.bitwise_not(mask)
#cv2.imshow('mask', m)
roi = cat[10:(logo_sharp[0]+10), 10:(logo_sharp[1]+10)]

tmp = cv2.bitwise_and(roi, roi, mask=m)

dst = cv2.add(tmp, logo)

cat[10:(logo_sharp[0]+10), 10:(logo_sharp[1]+10)] = dst

cv2.imshow('cat', cat)

#cv2.imwrite('./res/addlogo.jpg', cat)

cv2.waitKey(0)

